using System;
using System.Collections.Generic;
using System.Text;
using CMS.Core.DataInterfaces;
using CMS.Presenters.Views.ListManager;
using AjaxPro;
using System.Collections;
using CMS.Data;

namespace CMS.Presenters.Presenters.ListManager
{
    public class BaoCaoDonThuPresenter
    {
        IDonThuDao iDonThuDao;
        IBaoCaoDonThuView iBaoCaoDonThuView;

        public BaoCaoDonThuPresenter()
        { 
        
        }

        public BaoCaoDonThuPresenter(IBaoCaoDonThuView iBaoCaoDonThuView)
        {
            this.iBaoCaoDonThuView = iBaoCaoDonThuView;
            this.iBaoCaoDonThuView.LinhVucs = new LinhVucDao().GetFieldEqualCriteria("TrangThai", true);
            this.iBaoCaoDonThuView.DiaBans = new DiaBanDao().GetFieldEqualCriteria("TrangThai", true);
            this.iBaoCaoDonThuView.LoaiDons = new LoaiDonDao().GetFieldEqualCriteria("TrangThai", true);
        }

        [AjaxMethod]
        public IList SearchDonThus(string type, String txtTuNgay, String txtDenNgay, int maDiaBan, 
            int maLinhVuc, int maLoaiDon, int min, int max
            )
        {
            this.iDonThuDao = new DonThuDao();
            return this.iDonThuDao.SearchDonThus(type, txtTuNgay, txtDenNgay, maDiaBan, maLinhVuc, maLoaiDon, min, max);
        }

        [AjaxMethod]
        public int TotalSearchDonThus(string type, String txtTuNgay, String txtDenNgay, int maDiaBan,
            int maLinhVuc, int maLoaiDon
            )
        {
            this.iDonThuDao = new DonThuDao();
            return this.iDonThuDao.TotalSearchDonThus(type, txtTuNgay, txtDenNgay, maDiaBan, maLinhVuc, maLoaiDon);
        }  
    }
}
